package org.ithasu.filpilote.app.http;

import java.io.IOException;

import org.ithasu.filpilote.data.ControllerModel;
import org.ithasu.tools.net.http.HTTPTools;

import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;

public class StatusHandler implements HttpHandler {

	final ControllerModel model;

	public StatusHandler(ControllerModel model) {
		this.model = model;
	}

	@Override
	public void handle(HttpExchange arg0) throws IOException {
		HTTPTools.writeResponse(arg0, 200, "application/json", model.getJSONStatus().toJSONString().getBytes());
	}
}
